See if the rviz_animated_view_controller package offers what you need.
Edit:
Are there examples in C++?
No, there are not, afaik. But this is all really basic msg publication, so should be trivial to re-create in other languages.
Once I publish cameraPlacement messages - how can I tell Rviz to deal with them accordingly?
From the wik page on rviz_animated_view_controller
:
This package provides an RViz view controller plugin [..]
This particular view controller shows up in the drop-down list in the Views Panel in RViz.
Edit 2: from the RViz User Guide I linked, it appears you might also be able to achieve what you want by publishing a TF frame at the location of the CoM and by selecting the Third Person Follower camera, but I can't find that anymore in recent RViz versions. I doubt it will also automatically rotate around the frame though.