Consider providing an implementing of extension point of com.intellij.jvm.elementProvider (com.intellij.lang.jvm.facade.JvmElementProvider interface). This is the entry point for all synthetic declarations visible to Java files.
In this case you won’t need to register synthetic files in the project model, and it will be enough to generate instances of PsiClass on the fly (or cache them in a storage of your choice).
Can IntelliJ IDEA index a VirtualFile in memory?
That’s possible, you can implement a custom virtual file system, and files stored in such a VFS will be indexed. But this is a rather complex and not well documented approach. See com.intellij.openapi.vfs.newvfs.NewVirtualFileSystem as a starting point.