I haven't spend much time in Missoula, so I can't speak much about what's close to there other than I know sledding is closer.
We've gotten a lot of snow in Billings the past couple years, but generally the winters are milder than other parts of the state. It snows and melts off pretty quickly most times. Gets HOT in the summer. The town is really spread out so you can easily have 1/2 hr commute to work depending on where you live/work.
Cooke City/Top of the World: 2-1/2 to 3 hr drive. Gets a lot of snow but can get tracked up quick with out of state traffic flocking in. You can ride Through May and into June up there though if you want. Terrain is as extreme as you want to get. Frequent snowfall means a lot of socked-in, flat light days. 9000'+
Big Horns: 2 to 2-1/2 hr drive. Get some out of state traffic as well. I usually wait until later in the season to ride there since it is pretty rocky. 9000'+
Some riding south of Big Timber 1-1/2 hr away, but I've never been there.
Buck Ridge and Taylor's Fork South of Big Sky:3 hr drive. Some of my favorite riding and snow quality is good. Unload low at 6500' and ride 5-9 rough trail miles to 9000' where the riding's at.
Little Belt Mtns to the northwest: 3 hr drive. Has the largest groomed trail system in the state I think (300 miles?). Best place IMO to take new riders or the family out. Mild weather and terrain, generally low avy danger, but there are still some holes to get into. 6500-9000'
One thing about always planning to drive is you basically pick wherever has the best snow and go.
For dirt biking there's the BMC club. Runs about $400/year membership with 26 work hr commitment. Right on the south edge of town and has 1400 acres of hills with single track trails, MX track, small SX track, endurocross track, flat track oval, and hill climbs with racing opportunities. BLM South Hills dirt bike area borders BMC, but is smaller. Big BLM single track area known as Elk Basin about an hour southwest by Belfry. This is high desert single track terrain with plenty of rocks mixed in. Wide open hill climbing terrain to the south in Cowley, WY. Mountain single track to the southwest of Absarokee. Pryor Mountains to the south have riding too, but wider ATV/SxS type trails.