Because our postures cause us to lean forward (and most likely not fully extended our torso through our spine, but rather slouch), the best way to compensate is to strengthen the under worked areas.
There's a few things you could do.
Arx's suggestion is not a bad one. IIRC it's called a dumbbell reverse fly.
Basically there are several muscle groups in the back and shoulder you could work to pull help pull you back in to alignment and balance over time. You can google any of these exercise names to get some youtube examples of how to do them.
-Face pulls. Requires a machine or a resistance band. This will work your rhomboids (big back muscles by your shoulder blades), rear delt, shoulder girdle, maybe even a little bit of your rear traps. (The muscle that runs between your shoulder and neck. Over developed front traps are also a symptom of computer use and hunching.) This is probably one of the best exercises for the upper back and shoulder girdle. Pulling with two hands directly toward your face tends to align and balance both sides of your shoulders.
-Bent over dumbbell fly. This works many of the areas of the back, including the lats to some degree.
-Bent over dumbbell row. Usually done with a barbell instead of dumbbells, but can be done either way. Again it will hit your rear delt, rhomboids, maybe a little rear trap.
-Single arm bent over dumbbell raise. This can target either the lats or rear delt or a bit of both depending on your form. This is the one I'm currently working the hardest at to hit my rear delts.
-W Raise. Done standing with dumbbells. Will work your rear delt, bit of your rhomboids, bit of your traps.
Just to name a few.
Also some things to remember about posture.
-Sit tall. Lengthen your spine. Don't slouch down on yourself and compress the spine.
-Shoulders back and down, chest out, when standing or sitting. This is the best way to address the rounded, hunched shoulder look. If you've had the problem for years, you're going to feel fairly ridiculous doing it, like you're.....posturing, or something. It will also be tiring to maintain because your body has adapted to your current state and so it will take effort to keep your shoulders back. You want to hold your shoulders back to combat hunching, and you want to push them down to prevent "shrugging." You want your shoulders back, broad and low. Not forward, narrow and high.
-When sitting, remember: try to get your rear shoulders to touch the back of your seat, that's your mental cue you're not hunching forward. Get your tail bone to touch the back of the seat as well, that's your cue that, when leaning back in to your chair your lower back is adequately supported and fitting to the curvature of most office chairs. Another trick is to place a tennis ball against the small of your bad when sitting. If you place it there and hold it in place, not only are you maintaining the curvature of your lower back, you've got your shoulder back far enough to trap the tennis ball in place. You'll know you've slacked on your posture if the tennis ball slips out of place.
-Try to maintain an anterior pelvic tilt. If it's not apparent from the name, google how it looks. Essentially you want your hips tilted forward, top first. What this does is help preserve the curvature of your lower back and spine. Many, many many people have posterior tilted pelvises, where the bottom of your hips is tilted out and the top of your hips is tilted back. Imagine the bottom portion of a hip thrust, that's kind of how many of us stand, sit and walk these days. It causes a straightening and flattening of the lower back and spine, which you don't want. It's tough to control sometimes though, especially when sitting. There are several groups of stretches you can do on a regular basis to sort of help retrain the placement of your hips over time. One good trick to remember to maintain an anterior pelvic tilt when standing is: stick your butt out. It feels exaggerated but only probably because you're in a posterior pelvic tilt so often. However, if you're doing any squats you're probably already semi-aware of anterior/posterior pelvic tilting, since achieving an anterior pelvic tilt is the first movement in a hip hinge, which any proper squat begins with.
-Posture takes discipline. You can train your muscles, your joints and your tendons to adopt better posture, but it always require some degree of attention on your part. Just try to do a quick mental posture check every 20 minutes. For me, after working out for long enough, I'm starting to subconsciously be aware of bad posture. I'll be sitting there and go "man, feeling like crap." And then I'll go "Oh wait, posture." I'll reset everything and the difference is noticeable within a minute. Bad posture almost pulls on my muscles now in a way that feels unnatural and the more weight I lose, the more sensitive I get to the sensation.
-Your core strength can also impact posture, or at least your ability to maintain it for any degree of time. Maintaining thoracic extension requires a bit of core strength, as it's the group of muscles supporting extension next to your lower back. When your core is weak, or at least not strong enough to adequately support your current body weight, we tend to collapse down on ourselves like an accordion and start adopting a lot of postural habits to compensate and take the pressure off the lower back and spine. Mine is propping my feet up on something, which while it feels relaxing as hell, tends to put my lower back in a lot of weird, stressed, unsupported positions. And ever since I started really working my core, my abs do a much better job of keeping my stomach in, belly button toward spine, which helps many things. It helps push my pelvis toward an anterior tilt because I'm no longer carrying 15 pounds around my waist, above my hips. It makes keeping a long spine feel more natural because I'm not slouching as much due to, again, having less weight around my belly making "not slouching" an actual chore.
-As long as I'm on the whole posture chain......glutes! Our glutes are so fucking weak because they're basically in a deactivated state 90% of the day while we sit. And your glutes can have a large impact on the state of your lower back and maybe even your hips, which can then have a ripple effect all the way up your postural chain. The other weekend I did my normal leg routine, which now includes side lunges. My glutes got really worked from that exercise....but later that night I started feeling lower back tension. I worried that I'd improperly squatted or did kettle bell swings....so I did some googling.
I'll link this video because it will do a better job demonstrating than I will explaining:
https://www.youtube.com/watch?v=DWmGArQBtFIBut basically: your glute muscles attach to the top of your hip bones. When your glutes are tight or you have tension in them, they will pull down on your hips. Over time that will start causing you pain in your lower back that will feel like it originates from your lower back....but which is really it complaining about all the pulling from your glutes. Sitting doesn't help at all, in fact it sometimes exacerbates the pain. Doing the above stretch exercise though, I felt immediate relief and I don't necessarily have a lot of lower back problems. If your lower back seems sore from a workout and you've been doing anything with your glutes, try this out on both sides and see if it doesn't feel a little looser.
Back...to the back, here's another Athlean-X video about correcting rounded shoulders:
https://www.youtube.com/watch?v=oLwTC-lAJws