When you build for 64 bits the PtrToUlong function returns a truncated 32 bit value which cannot be converted back to a valid 64-bit pointer. The source for ULongToPtr contains this warning - "Caution: ULongToPtr() zero-extends the unsigned long value." That is why round-tripping is problematic.
Try this -
ULONG_PTR ul = (ULONG_PTR) obj;
std::cout << "UL:" << ul << std::endl;
CStroageClass* so = reinterpret_cast<CStroageClass*>(ul);