You could get your c++ program to create HTML headers etc and then call it directly. You might have to put it in the cgi-bin directory and call it like this
http://www.whatever.com/cgi-bin/app_name
OR
you could create a c++ program without the html tags and put it into a php script like this
<HEAD></HEAD><BODY>
<? system("cgi-bin/app_name") ?>
</BODY>
but this is not efficent and possbily not very secure.
I suspect vincents approach is probably the best (usually is!)
Vincent - is my first option what you meant? Would you have to modify httpd.conf?