The problem is in the destruction of the CComSafeArray. When you assign the data directly to CComSafeArray.m_psa either by
pmyInterface->GetData( ((SAFEARRAY**)&pSafeArgs )))
or
pmyInterface->GetData( &(pSafeArgs.m_psa) );
then the class does not call Lock(). When the destructor fires it fails because it tries to call UnLock() and Lock() hasn't been called. When you assign the data through Attach() or an assignment operator then Lock() is called and the destructor is happy. Unfortunately they made the Lock() and Unlock() methods protected so you can't call Lock() on your own either.