How to run CppBackend with Kaleidoscope?

Is there example code of how to construct the CPPTargetMachine and run addPassesToEmitFile method with Kaleidoscope example?

Any help is appreciated.

Thanks.
Richard Catlin