The XMLDocument is an older XML parser, you want do create the DOMDocument parser. To do this, change the CLSID from CLSID_XMLDocument to CLSID_DOMDocument.

Also, you mentioned that you were in an MFC app, it might be a good idea to use the AfxOleInit method instead of CoInitializeEx. Directly initializing COM, while it will work, may cause problems for you down the road if you use any of MFC's COM support.