In addition to the WWDC Session Video Session 102 - Implementing UIViewController Containment that hypercrypt already mentioned, Apple WWDC 2012 session on "The Evolution of View Controllers on iOS" also covers this topic and the example code is part of the sample code package:
https://developer.apple.com/devcenter/download.action?path=/wwdc_2012/wwdc_2012_sample_code/wwdc_2012_session_code.dmg
There's also an example here:
https://github.com/toolmanGitHub/stackedViewControllers