In general you can't cast an object of one class to another class (with or without CObject). So explain, please, your true problem.
In MFC environment you derive the class from the CObject if you need CObject functionality (serialization, for example). Then you may pass CObject pointer or reference to the derived class object and use it in a function as a polymorphic (CObject type) object via virtual functions. You don't cast it, you use it as a CObject object.
What else?
Can you present minimal pseudocode snippet with desired ops on your generic argument?