Im hoping to do just what you talked about this summer. I spent last semester, and summer in spain, and just have to go back!!
Iv done a lot of searching and got some ideas, but so far, the best thing Iv found to do is get with an organization or group that will help you organize the entire thing, get set up with something before you leave the USA, and get proper visas and stuff so that it is legal. I joined AIESEC for that reason. Im still entirely open to other options though, so let me know if you find anything out! If you do a search under this forum, you can probably find my other posts on this kind of thing (sorry MM, i dont know how to do that linking thing haha).
Good Luck!
Kelly