I was kidding about F#, throwing a relatively obscure language out there for a relatively obscure question.
There's no "right" AND easy way of doing it. There's the Mozilla ActiveX control that might help:
http://www.iol.ie/~locka/mozilla/control.htmNot certain of its state of maintenance however.
Then here's the COM way:
http://www.mozilla.org/projects/xpcom/
COM is a pain in the butt, but I'm pretty sure you can do exactly what you're looking for here.
Both IE and Firefox are accessible if you grab them by handle, but then you're going to have to go digging for the specific stuff you're looking for.