How do I create an instance of a COM object in C++ if I don't know its CLSID or IID at compile time?

In case I've got my terminology mixed up - which is entirely possible, since I'm somewhat new to COM - I'll try to explain myself again.

What I mean is, I know how to create an instance of an ATL/COM object that I've written, but it requires me to include the header and .c files from the ATL object. For instance, if I create an ATL/COM object called "Test", then I need to include "Test.h" and "Test_i.c" in my client program, otherwise I get "unresolved external symbol" on the IID and CLSID that I need to create the object with CoCreateInstance.

How do I create one like in VB, where you don't have to anything about the object in advance? Presumably, if you can read the ID string from a file for VB, then you can read the GUID and interface IDs from a file (or the registry) for VC?

Also, while I'm thinking about it, if I don't know at compile time what type of interface I'm using, how do I call functions on the interface pointer? Normally I'd have a variable that points to the interface ("ITest* m_pTest"), but whta do I do when I don't know? A "void*" isn't going to work, is it?

Sorry for being so unfocused, but I can't find *any* examples in MSDN.

Thanks in advance...

Paul.