Thanks! I wanna ask for a little more. In Apple i try to hide a struct. It is not on the interface to the client. But the other class in the COM know it is there, and can access it. in apple.h struct Image { int num; }; // CApple class ATL_NO_VTABLE CApple : public CComObjectRootEx, public CComCoClass, public IDispatchImpl { public: Image img; CApple() { } The banana add a method interface IBanana : IDispatch{ [id(1), helpstring("GetApple")] HRESULT GetApple([out,retval] IApple** apple); [id(2), helpstring("QueryApple")] HRESULT QueryApple([in] IApple* apple, [out,retval] int * ret); }; And in banana.cpp i try STDMETHODIMP CBanana::GetApple(IApple** apple) { CApple* p = new CComObject(); p->img.num = 100; *apple = p; return S_OK; } STDMETHODIMP CBanana::QueryApple(IApple* apple, int* ret) { CApple* p = dynamic_cast(apple); *ret = p->img.num; return S_OK; } But when i use this dll in c#, it always get a System.ExecutionEngineException. the script is FruitLib.Banana banana = new FruitLib.BananaClass(); FruitLib.Apple apple = banana.GetApple(); int n = banana.QueryApple(apple); Any idea then? Thanks!