Pi RTD Server create instance

instead of using excel for getting RT data i tried in C# with reflection and found there is some error in disconnectdata. When tried with VC++, for cocreateinstance with IID of IRtdServer, instance creation failed.
snippet is as follows:
const CLSID IID_RTD_UpdateEvent = {0xa43788c1, 0xd91b, 0x11d3,
0x8f, 0x39, 0x00, 0xc0, 0x4f, 0x36, 0x51, 0xb8};
const CLSID CLSID_RTD = {0x5bec7447, 0xb54e, 0x4d03,
0xb2, 0x09, 0x9c, 0xfb, 0x9b, 0xe7, 0xae, 0x6e};
const CLSID IID_RTD = {0xec0e6191, 0xdb41, 0x11d3,
0x8f, 0xe3, 0x00, 0xc0, 0x4f, 0x36, 0x51, 0xb8};
cout << “CoInitializing” << endl;

// if CoCreateInstance doesn't work, nothing else will
 cout << "Checking CoCreateInstance" << endl;
 IRtdServer* obj;
 const auto hr = CoCreateInstance(CLSID_RTD,
 if(hr!= S_OK)
     throw runtime_error("CoCreateInstance failed:\n " + GetLastErrorAsString());
Here error code returning is zero.

Is there any trick to do it in VC++?