Yes, it works for C++ classes, too. You can expose any vtkRenderWindow in the web browser using vtkRemoteView. This is how ParaView (implemented in C++) is made available via Trame using remote rendering. You only need a few small Python files to describe your view layout and if you want to use any web widgets.