I'm afraid my C++ is pretty lame but two things, does your transform produce xml, not html or text? If either of these last two then you'll need a stream to output to rather than a domdocument.
Secondly you should specify the version numbers on the prog ids and make sure they all match, Msxml2.FreeThreadedDOMDocument.4.0 for instance.
Can you post the xml and xslt if this doesn't help?
Joe (Microsoft MVP - XML