Just to be clear, that means I can take a dragon of, say, 15 hit dice, and then get 10 class levels.
Yes. However, only a few dragons have so little hit dice, and they pay quite a bit for it.
For example, a Young Adult White Dragon would have 15 racial HD and 10 class HD. He could also take a template that gives up to +6 CR, since his CR (8) is lower than that of a Young Adult Gold Dragon (14). (However, no template actually give that much CR, and template-stacking is not allowed).
Also, keep in mind that dragon racial HD are very good - they offer you the highest possible hit dice (D12), they grant all good saves and full attack bonus, and 6 skillpoints per HD to boot! No class can beat that, and reducing your age or playing a weaker race will almost always also cost you an equivalent reduction in spellcasting - and since i made sure that all dragons would be at a level where they have spellcasting, and that you can't regress your age infinitely, you always loose a lot by being younger.
A quick overview:
An Adult Gold Dragon has 23 HD. With 2 levels in Sorcerer or a similar prestige class, he would have 33 Str, 10 Dex, 21 Con, 20 Int 21 Wis and 20 Cha, a BAB of +23, an AC of 30 and +24/14/26 saves. He'd have a caster level of 9, a spell resistance of 23, DR 5/magic and a 12D10 (DC26) breath weapon, along with a Frightful presence with a DC of 26.
A Young Adult White Dragon with the Half-Celestial Template has 15 racial HD. With 10 levels in Sorcerer or a similar prestige class, he would have 27 Str, 12 Dex, 21 Con, 10 Int, 15 Wis and 16 Cha (if he gains +2 cha from having 10 class levels), a BAB of 15, an AC of 24 and +20/13/18 saves. He'd have a caster level of 10, a spell resistance of 25 (from half-celestial), DR 10/Magic (from half-celestial) and several powerful spell-like abilities, the most powerful being Mass Charm Monster. He could also have quite a few special abilities from prestige classes.
Basically, a lower-CR dragon will gain more customization-options, in exchange for being more specialized and loosing out in the areas he does not specialize in - in my example the Young Adult White Dragon has somewhat better spellcasting abilities (only marginally so, but other dragon types might be better - a young adult green could get 11 casterlevels and a charisma of 20), but he has much lower attributes, worse saves and armor class and only has better spell resistance due to his template.
If i am right (i haven't play-tested this or anything), playing a younger, weaker-type dragon will allow you to fulfill roles like rogue, and you can gain somewhat better spellcasting, but you pay quite a lot for it. A good prestige class might make up for that, but if we disregard the really cheesy ones (which could just be banned) it seems quite balanced to me.
Here is another example with a Half-Celestial Adult Song Voice-Dragon:
20 Racial HD, 5 levels as Lyric Thaumaturge. 22 Str, 12 Dex, 21 Con, 22 Int 26, Wis, 26 Cha. BAB 26, AC 29, +18/17/23 saves. Caster level 10, spell resistance 30, DR 10/magic, all celestial spell-like abilities. Bardic Music like a 25th-level bard, 1 extra 1-4th level spellslot, one extra 1st and 2nd level spell known.
The most cheese i could squeeze into a dragon-build like that would be using prestige classes like Sublime Chord, which could give a young adult Songdragon (and similar ones) 8th-level spells. An easy fix would be to ban such prestige classes (there are only a few of those anyway), or to alter their spellcasting into simple +spellcaster level.
Sorcerer levels are actually stated in the rules-as-written to stack with dragon spellcasting abilities! So do +spellcasting level from prestige classes.
A Voice-Dragon is not casting like a Bard, he can just learn Bard-spells like other Dragons can learn Cleric-spells and gains Bardic music based on his caster level. That bardic music (and other special abilties from other archetypes) would stack with bard-levels, but if he came a Bard 1 he could cast as a dragon and as a first-levle bard (there is however a "bard" prestige class which would add to his normal spellcasting).
However, i would say that taking classes that only advance bard-casting would be fine, and archetypes that can cast cleric-spells might take classes that advance cleric-casting (still have to check that though, might get broken).