In fact, you hit a very specific topic of importing COM server in your C++ program. Very little it has to do with C++ real complexities, but requires quite a good knowledge of COM technology.

I don't know the background, but say in VB, VBScript or JScript it would look much and much simpler, and maybe you should try with some language other than C++.