A pointer to IDispatch is converted to a LuaCOMobject whose implementation is provided by this pointer. If the object is implemented by local Lua table, then the pointer is converted to this table. A LuaCOMobject is converted to COM simply passing its interface implementation to COM.