Objects through COMS

I am using C++ objects defined in a COM in other COM. I get the objects
using a casting to my object type from a long pointer. For example, the code
in a COM which access to the object of another COM (called COM1) is like:

    long pointer;
    com1->GetObjectA(&pointer);
    ObjectA *stack = (ObjectA*) pointer;

It works, but I need to know if there is other way to this in a better
style. Basically my questions are: Can I use an object reserved in a COM in
another? How must I get an object from another COM?

Thank you in advanced.
Jose.