I've been fighting this for a a while and have made some pretty good improvements; just by consiously putting my shoulders back and standing up straight. If you keep correcting it, eventually your posture will get better and better.
My favorite exercise for posture believe it or not is squats, as I find it forces me keep my shoulders back in the proper position to be able to lift any amount of weight.
I read somewhere that there are three main types of posture:
-Standing
-Sitting
-Sleeping (kinda clueless about this)
So maybe find a posture in the mirror that you think looks good for standing and sitting, and then try to emulate it all the time.
Good luck