Co-Simulation via C++

Could can give an example of how this would work? I would like to learn something new.