You know what really worked for me? A yoga ball! Sitting on one instead of a computer chair/desk chair actually got rid of a lot of slouching that I do, and also go rid of back pain I had been suffering from since my car accident. My spine used to fall out of alignment fairly commonly, and now, I have not been out of place in a very long time. It worked for me and thats why I recommend it first.
Second, and easiest - make sure your bra is the right size for your body, and offering you the right type of support. This is where a lot of slouching is inspired. If your upper body is supported properly, you can lose a lot of slouching.
For a stronger back, I highly recommend some yoga, and some weight training. Yoga will help ensure that your body is in proper alignment (as well as your core strength), and resistance training will help you build muscle! I recommend pull ups (assisted if need be) seated rows, lat pull downs and supermans! If you have a yoga ball you can also back extensions with that. The supermans and back extensions will really help target your lower back, while the pull ups etc will target your upper back. Both need to be in good shape for no slouching!