First order approximation: Ride your bike. Then ride it some more. Rinse, repeat.
Address ergonomic issues (saddle, hand position, etc) as they come up, aim to get to the top of climbs in one go[1] without completely exhausting yourself (however slow that might be), and by the time you're decently comfortable the legs should have taken care of themselves. At which point "it doesn't get any easier, you just go faster" applies. You'll likely manage with fewer carbs as you go on, though rides of over about 100km deteriorate into managing your digestion (and eventually, sleep).
Or I suppose you could do it properly. Exercises, training, gyms and whatnot. I wouldn't know about that sort of thing. No doubt there'll be a PE teacher along with some advice shortly...
Never having tried them, I'm not sure how well these computer game things map to the real world. Personally I find indoor cycling[2] soul-destroyingly dull, and would rather be out in the pissing rain (at least for the hour or two my sense of humour holds up for) unless I was recovering from an injury or something. But I know some forumites use them, so hopefully they'll have some input.
[1] My advice to complete newbie cyclists is to climb hills in a gear or two lower than the one that seems comfortable.
[2] Other than whizzing around on a velodrome, which is many things, but never dull.