I'm currently coding a reverse connection shell. (please avoid stereotypes today)

Jack's Box <> shell < Jill'x Box

Basically, I need a clean way to pass a defined host a windows command shell (cmd.exe).
Is there a clever trick to throw the host a system() command?
Or perhaps initiate cmd.exe locally and copy input/output to buffers then send over socket?
I realize this will need to be client/server. I just need help with getting it mapped out in my brain. I kind of just slapped all my thoughts on it in here so maybe someone can organize me or put me on the right path.