A failed startup is nothing to be embarrassed about, most of us don't have the guts to try it! You shouldn't expect much interest in the code, the value of a company's code without the business and people is quite negative when there isn't some technical secret sauce. Even if there was some technical wizardry people would just care about understanding how that one part worked and probably not use any of the code itse…
1) You should not build a tech startup unless you have either a business plan for getting revenue quickly or shit ton of investment. And you won't typically get investment unless you have at least some notion of where the business is going to be. I've made this mistake. Techies mostly don't understand the business side well enough for this to work.
2) Most companies aren't startups. They are just companies. With revenue. That pay the bills. A startup is a company without revenue that is living on borrowed time and money. Especially if that's your own money, you need a plan for this.
3) VC funded companies mostly fail. A VC's business is to ensure that those companies that are going to fail, fail quickly. They fund their VC business with the handful of companies that don't fail and succeed spectacularly. So, getting "accelerated" or "funded" doesn't mean that you are on a path to success. It actually means you are on the spot to beat the odds and that you don't have a lot of time left. Chances are that you will fail quickly.
4) If you are a successful company with revenue, you don't need VCs. So you should question why you are talking to them at all? Are you struggling to make revenue? A VC won't fix that.
5) A lot of VCs are lazy and don't get interested until you are already successful. There is a weird dynamic here where companies get funded early and then fail. Or don't get funded and then succeed.
My current company is four years into being completely bootstrapped. As in we struggle with revenue and we put in our time when able. I mostly live off consultancy that I do on the side. The company just had its third most successful year in a row and is getting close to where I should be able to retire as a consultant soonish and focus on the business instead. But it's been a long journey.
As for open source. I open source anything that is not business specific or part of our core IP. One good reason for this is that I hate rebuilding the same crap when I start my next company. I've been through this and that kind of stuff just slows you down. People obsess about intellectual property in startups. The reality is that most software is not that valuable. But you still need to spend time, money, and energy building it.
So, I contribute a lot of tools, frameworks and what not of which I am the main user. Just so I can continue to use that stuff on the next project.