Yes, the void* must be a UObject derived class pointer.
Actually what I want to achieve is getting a interface pointer from this void ptr.
And after some inspection to UClass code, I found there are interfaces array and there are the offset value to the interface pointer. I added that value to the ptr and and get working interface now.
void* data = ~~~;
for (auto& it : staticClass->Interfaces)
{
if (it.Class->IsChildOf(USomeInterface::StaticClass())
{
ISomeInterface* iface = reinterpret_cast<ISomeInterface*>(reinterpret_cast<uint8*>(data) + it.PointerOffset);
// I can use the iface now
}
}