The whole Solyndra debacle (and the 38 studios one) do well to illustrate in which situations government investment in economic development is wholly unhelpful and perhaps rather unwise.
The short of it is that this sort of economic development put way too much towards the wrong kinds of ventures and was made with far too little insight. They're two of the absolute worst kinds of products to second guess the market and investors on, the potential secondary benefits that could justify such government spending were few compared to other possibilities, and the individual costs compared to other comparable projects in terms of economic development/job creation were very high.
Long ass bit
Spoiler
In general, this sort of investment should not be made to expand production of an existing technology or to incentive production of a commodity or production of a product that while novel represents no new tangible technological development - and most especially not when any single project requires many times the cost of a single fundamental research grant.
Solyndra for example had developed their technology well before they requested and were granted the large loans in question. The technological development which I'd argue would offer significant cause for government investment had already been done. The federal aid did not pay to develop the technology but rather to build a factory that the market determined the technology offered insufficient cause to justify. Nor was this a small expense compared to other potential job creation projects such as infrastructure projects - given that the research and development had already be done I would say these things could be argued to be of comparable technological/scientific interest to the government at that point.
After research and development what they were proposing to produce was essentially a commodity item directly comparable in terms of things like either cost per kwhr or cost per kwhr per square unit space. As such whether or not the production of those panels is a sound and profitable venture is a question of whether they can be produced at costs competitive with the existing market or offer significantly higher power production-area densities than their competitors (in instances where the limiting factor of adoption/use is the cost/availibility of space to put hem). For all their flaws, this is one of those things that the market and investors are particularly well equipped to consider and is the inherently obvious result of not-too-complex calculation.
So any venture of this nature which is unable to find private backing should be viewed as highly likely to either be of extremely high risk or to have a risk/reward which is too challenging to calculate in a reliable manner. This means that projects which, unlike fundamental scientific research, do not pose inherent difficulty in estimating what commercial value they may produce are far more likely to fall into the first category. So a project that would produce solar panels or a video game - which both have relatively estimable values per unit - should be looked at as having been rejected by investors because it was perceived it could not profitably compete for one reason or another.
Thus, any such project should be viewed as inherently likely to fail as a profitable venture. For such a project to be worth offering a government-backed loan or a grant it must offer some benefit besides its potential as a profitable business because the market has determined this is unlikely to be true. Since this determination is something the market, for all its flaws, is particulary well suited to make then the benefit should likely be something for which the market is particularly ill-suited to judge.
Fundamental scientific research - for which the prospects of near-term profitable developments can be extremely difficult to predict - are perhaps the clearest example of this. Though the general long term benefit to society and industry of scientific advancement is an obvious lesson of history, the profit potential of any individual element of research is often unpredictable and almost as often hard guess at even years after the fact. In that case the market is ill suited to serve as an investment base to fund scientific discovery while the potential benefit taxpayer and industry does give an incentive for government investment.
Projects which center around or require some element of fundamental scientific research in order to be developed should also be included in this. This includes such general technologies as nanotechnology and, in the past, computer and information technologies. These are areas where highly profitable products may already be envisaged but the development of which is hindered by a lack of scientific and engineering knowledge to make them feasible. In these cases I would suggest something akin to a modified version of some of the the DARPA cooperative grants of a couple decades ago. That is to say that such projects should be required to meet research and development milestones for continued funding, that they be subject to auditing/oversight, that fundamental scientific research be published, and that the awardees retain ownership on patents under some conditions. Ownership could be subject to requirements that the patent be used primarily within the United States and/or that if the patent is profitable the awardee must pay a small portion until such time as that amount totals the initial grant or the patent and any derivatives are no longer profitable.
Additionally it may be determined that investment in or subsidization of general economic development is desirable in and of itself. This could be particularly true in times where the capitol market is unusually tight. Compared to times when the financial market is more liquid, there are more ventures which fail to obtain start-up capitol because they can not afford the increased cost of borrowing yet do not represent an unusually high risk of failure or because the basis of risk assessment has become more conservative. At such points it does make sense for there to be a form of credit for those ventures which, only in light of tighter liquidity or more risk averse investors, fall just shy of being considered acceptable investments. It could also be the case that it may be beneficial to always offer some small level of development aid to reduce the barriers to market entry.
In light of the poor track record of the government as an investor and the potential for abuse, such development subsidies should be subject to strict independent financial oversight and limited to small loans with any malfeasance of either end being severely punished. In this way one would maximize the risks to those who would engage in fraud either inside or outside the system and collusion of both; it would simultaneously minimize the potential reward for those considering such fraud. Working under the assumption that fraud and - to a greater extent - mismanagement would still be inevitable to some degree the limitations on individual investment amounts would minimize the losses from those incidents you could not prevent beforehand.
In any case though the value of the program on a whole must be honestly argued to be speculative and the determination of acceptable costs tempered by the understanding that most individual investments will be a loss. Any calculable return on investment from economic development must be considered in terms of increased spending while under loan funding and with a realistic (likely small) percentage of those ventures continuing profitably afterwards. Any other potential merits that could be argued must be presented honestly as more philosophical. This is true even in the case of scientific-research focused loans/grants. While the benefit should be obvious from an historical frame of reference, how much to invest must be made with the clear and honest understanding that profitable returns even to the larger society are incredibly difficult to predict.
Both Solyndra and 38 Studios are excellent examples of the kinds of things the government should be the least interested in spending money on. In terms of economic development they represented high risks and large single expenditures compared to other comparably stimulative investments. In terms of secondary benefits that the market is not well equipped to evaluate, they represented clearly inferior choices to projects such as fundamental research and infrastructure.
I would hope examples like this highlight the need for independent oversight as well as strict rules governing conflict of interest and elligibility for any of these economic development programs. I would rather that second lesson learned from this is not that the government can't do things for the economy but instead that the government shouldn't second guess the kinds of determinations the market is especially good at making and recognize its roll in those things the market is particularly ill equipped to value. There's a reason that the government handles things like law enforcement while the market usually does a good job regulating the production levels of commodities. The principles that make the roles of each in those situations obvious should not be entirely ignored in other questions of governance and market economics.