At Sonicity, we built a content distribution network in a box, optimized for RTP-style streaming delivery and FEC file transfers with FLID/DL-style congestion control (we did this before there was a FLID/DL, so I'm kind of proud of it). I owned the "router" component, which was tens of thousands of lines of Quantify-optimized asynchronous C++ and ran multicast routing over an IS-IS-style link state routing protocol (the product started out as "IRC without netsplits" and, uh, metastasized).
In the last 6 months at the company, we managed to refactor the design so that the hairiest routing and group management code could get hoisted out of C++, and most CDN participant hosts could just run a tiny stub forwarder that was simple enough to be kernel-resident (a design I awesomely rejected when one of my cofounders proposed it at the start of the company).
The whole source tree was many hundreds of thousands of lines; it was cross-platform Win32 and Linux with graphical clients on each platform and IE integration. There was a lot of good stuff there. My friends Danny, Kneel, Andy, and Tim all worked on it at various times and they are, unlike me, ridiculously good.
Poof. All gone.
This is what happens when you take VC and your company fails. What's better is that by taking VC, you drastically increase your chances of failing; VCs need you to shoot the moon. Our VCs decided what we should do with all that code was to go head to head against Akamai.
You may get lucky with a very, very cool investor who gifts your IP back to you. But you're not entitled to that and you probably won't get it.