I am guessing that a ref class in c++ is a language syntax wrapper around shared_ptr. I have to guess because C++/CX is limited to winRT apps, so I cannot experiment with ref class in a win32 app.
"...A ref class (as in C++/CX) requires WinRT and WinRT is only present in Win8. So no way that will work on Win7, WinRT is not COM despite having a lot of things in common. ..."
"... It does implement automatic reference counting but there's more than that. For example such classes can be instantiated by non C++ code, this is done through a "activation factory" which resembles the class factory found in COM but it's different. If you try to create a dll that contains C++/CX classes you'll see that it depends on vccorlib.dll and that in turn depends on WinRT specific functions like RoInitialize, RoGetActivationFactory etc. ..."