I have always had bad posture, and working on a computer has not helped... Here is a link explaining rather technically the types of bad posture, and how you can do certain exercise to fix it.
The most common problem, especially after being on a computer is forward head posture and protacted shoulder girdle (i.e. forward slumped shoulders).
The basic idea is to strengthen the back muscles and stretch the chest muscles. Unfortunately, the two biggest vanity exercises (bench presses and crunches) can make your posture worse. If you do those exercise be sure to do back exercise to balance them out.
Here is a link on an easy way to stretch chest muscles
Here is a video about an easy way to strengthen back muscles, and the muscles in the back of your neck.