If you agree to use .NET and C++/CLI instead of plain C++ you can create .NET software which will run on another OS (and of course on Linux) under Mono without re-compilation.
See:
http://en.wikipedia.org/wiki/Mono_(software)[
^],
http://www.mono-project.com/[
^].
You will need to use the standard subset of .NET library plus number of non-standard assemblies like
System.Windows.Forms
to be compatible with Mono. You can also install Mono on Windows and run it under Mono on Windows or use it for development. I develop my windowed UI with Forms and run it on Linix without re-compilation. This is the only opportunity supported by C++ I know. (Another popular way is Java, but you're asking only about C++, right?)
There is a number of other platforms to write UI using C++ which can be run on Windows and Linux, but they all will need separate build for each system. It includes GTK++, Qt and more.
Good luck,
—SA