Just to take Apple's example (they also rely on other asian countries for certain parts, ie. Korea & Taiwan comes to my mind right now), if they were to not rely on China to assemble/manufacture their products Apple products would have been even more expensive.
Also your iphone being defective has nothing to do with the fact that they were manufactured in China. While China made goods tends to be of low quality. High end computer gadgets like apple/dell goes through a certain high standard of manufacturing than your typical Chinese stuff. Companies tends to have a more hands-on approach to maintaining a certain standard and quality, which is generally missing in other chinese made products.
The problem is not that apple / google / MSFT invests and does business in China. The problem is that our government have legitimized Chinese style of government (a unique variant of communism), regardless how much they criticize on the side. Our government does not confront Chinese government directly. Its already too late to do anything now - we are too connected with their economy. If they go down - we go down, if we go down - they go down too.
The government can't do anything or the companies can't do anything without shooting their own leg. The only way we could pressure Chinese government is to start some kind of mass movement where we refuse to buy products manufactured in China (or similar government with questionable human-right records).
Its easier said than done, but the change has to come from us.