There are libraries and frameworks.
Note that before Java adoption push we had stuff like ATLServer, and the first version of ASP were basically COM libraries being called from VBscript/JScript.
On our case, we were calling C code from TCL scripts, using plugins like mod_tcl.
Nowadays you have stuff like Boost ASIO and Wt.
However I wouldn't plug C or C++ directly into the Internet, rather call them from managed languages, as native libraries, reducing the risk of possible exploits.