Be sure to scroll down... there may be more than one question on this page!
First things first... let's find out if the carpet is indeed under the walls. If the carpet is not under the walls, you should be able to lift a corner of the carpet off the mounting or "tackless" strips that are normally installed around the perimeter of the room. Grab the carpet near the corner with a pair of clean pliers and give it a firm upward pull. If it does not lift, it may indeed be under the walls. Try pulling at all the corners, since it would probably only be under interior walls, not exterior walls... and maybe not all the interior walls, either!
You can use a sharp utility knife to cut the carpet free along any walls where necessary. Then it can be restretched. Make sure that the carpet under the walls is trimmed back enough so it doesn't show, even if you have to go back and do a second trimming!
Tackless strips will have to be installed along all walls that don't already have them. These nail-embedded strips grab and hold the carpet in place after stretching.
I don't have any specific articles on the NH site concerning stretching carpet yet, but the tools are available for rental at most any rent-it center and the folks there can give you instructions. It is more difficult to explain (without pictures) than it is to do. They will be able to supply you with a special carpet cutter also, which is the easiest way to trim the excess carpet around the edges of the room as you stretch it.