Seems that i have found out the problem.. I replaced CLSCTX_INPROC_SERVER with CLSCTX_LOCAL_SERVER in CoCreateInstance(). But now i am facing a different problem. I have defined a method in my interface as. STDMETHODIMP CFirst_ATL::AddNumbers(LONG x, LONG y, LONG* z) { *z = x + y; return S_OK; } when i try calling this method from client as hr = IFirst_ATL->AddNumbers(5, 7, &ReturnValue); the method returns S_OK, but the value in ReturnValue is some garbage value. Can anyone please advice where have i went wrong? Thanks!