Aside from stretching, you can also do warmup sets as a quicker alternative to the treadmill. Do one or two sets of whatever exercise you're going to do at about half the weight you'd normally do it before starting the actual workout.
If you're not used to lifting (or haven't done it in a very long time), your very first couple of sessions will leave you
much more sore than usual, that's normal. Just give yourself time to recover before you go back, this is mostly your body adjusting doing something hard it's not used to. Don't go back until you're fully recovered.
Also make sure you're not lifting too much your first couple of sessions - you shouldn't be trying to hit your max just yet, that will get you injured when you haven't developed the structure to support that weight. Once your body gets more used to it, you can up the weight as you go. You definitely shouldn't be getting any swelling, that's an indication you went in a little too hard. Do less weight next time, and work your way back up over several sessions. Finally, make sure you're lifting doing the correct form - if you ever have to sacrifice proper form to lift the weight, you're doing too much weight. Doing an exercise without proper form is an easy way to injure yourself. If you don't know what the proper form is, you can just look it up on youtube, there's tons of videos explaining how to do pretty much any exercise you'd care to try.
Since you mentioned machines, I'd also give this advice: when starting out, your primary goal should be to just get stronger overall, so you should try to focus on compound exercises (ones that target several muscle groups all at once, i.e.: deadlifts, squats, bench press) and avoid isolation exercises (ones that only hit a very narrow range of muscles: i.e. bicep curls). More barbells, less dumbbells in general. A small number of broad-coverage lifts will be much more effective for you than a large number of very specific ones.
Edit: If you want more specific information, this is a good starting point:
http://forum.bodybuilding.com/showthread.php?t=118920551