Look at bitaddress.org source code. It's very easy to read. Near the end there is the wallet details tab. You'll see there which functions are called to get the public key. Search back for the function and see how it's done.
This code is also good as a template for writing in other languages.
eg. some bits chopped out,
var ecparams = EllipticCurve.getSECCurveByName("secp256k1");
ECKey.prototype.getPub = function () {
if (this.pub) return this.pub;
return this.pub = ecparams.getG().multiply(this.priv).getEncoded(0);
};
ECKey.prototype.getPubKeyHex = function () {
if (this.pubKeyHex) return this.pubKeyHex;
return this.pubKeyHex = Crypto.util.bytesToHex(this.getPub()).toString().toUpperCase();
};
A bit more digging and should have it.