"You get what you pay for." This is absolutely correct, and is where much outsourcing goes wrong.
I work for a company that does contract engineering or "outsourcing as a team". We are based in Indianapolis, speak English, answer phone calls, do our best to accurately estimate work, and are very up front about our areas of expertise. In almost all cases, I think we do an excellent job of representing ourselves, and what we are capable of. We have been in business for 15 years, are employee owned, and have almost no employee turnover. We currently have about 70 employees. We specialize in consumer electronics, medical, and industrial products, and do schematic design, mechanical design, ecad, mcad, prototyping, firmware development and testing. Many of our devices are Linux based, or on smaller parts run a custom OS developed in house. We are very strict in enforcing NDA agreements that we have in place with our customers.
Being in this industry for so long, we receive lots of projects that have come out of failed business relationships with competitors. This highlights my main point, and that is that you must do business with someone you trust. If you are worried about "opening up core libraries", and hiding your IP from the software engineers you are paying, then you have the wrong partner.
On the same token, we see a lot of trends in failed projects that come to us for repair after a failed relationship with a competitor. One of the biggest is that customers do not value or do not wish to pay for documentation. Without paying for a requirements document, and an architecture document, with review sign offs, there is nothing written down that says both sides agree on what is being produced. Many customers come to use thinking they have already done their architecture, and that they have all the details figured out. We find that in almost all cases, this is not correct. A 10 page document is not an architecture, and a 1 piece marketing blurb is not requirements.
Another common failure is lack of communication. At a very minimum, an hour a week to meet and discuss progress is important. If either side has a problem with this, the relationship is in big trouble.
I could go on and on, but it starts to sound like an advertising spiel. Virtually all of our projects end in success, and we work hard to hold up our side of the bargain. the counterpoint to that is that we are not "cheap". We are very talented, many of us have masters degrees in technical areas, and we generally do a lot more designs in a given time than most of our clients, so we grow experience faster with different vendors / libraries / platforms / parts / tools, what have you. We need to make a living, be able to pay our expenses, and be able to attract good talent, so we charge accordingly. Our project success rate, and the number of clients that return to us again and again justifies this. In almost all cases, I think that we end up saving our clients money, due to reducing their overhead of hiring and managing engineers, and our ability to get their projects done faster.