Claus,
Once you have HttpContext you will need to invoke EPiServer.Common.Settings.LoadSettings(). I think that that in turn will require you to have an app.config, simillar to a web.config, in your application, a license file in the bin-folder and probably a few other files from a real installation as well.
It was a while since I last did this so I'm not a 100% sure what LoadSettings() will require, but perhaps you can try it out and let us know if it worked, and if it didn't, what exception is thrown.