If you're looking to build muscle mass, you have to ensure that you're eating more calories than you're burning. You especially need to make sure that your protein intake is adequate (if you eat meat and drink milk you're probably fine on that front). Also eat immediately after workouts.
If your diet is fine, the best way to add muscle mass on a bike would be hill repeats. Find a steep hill and hammer up it. Coast back down. Repeat.
Off the bike, the best leg exercise is generally considered to be the squat. I like the deadlift and incline leg press too.
Don't make the mistake of thinking that huge legs are necessarily going to make you a speed demon on the bike, however - on an upright bike, you can never press harder on the pedals than your own weight. And if you can stand up with one leg, which I assume you can, you have that much strength already. Becoming faster is more a function of muscle tone, pedaling efficiency, cardiovascular conditioning, aerodynamics, and good bike handling.