I think your original post kind of contains your answer already, and you just left out of the example you presented. As you pointed out, monsters get HDs for their sizes. The playable races already contain members of different sizes (medium and small), who do not roll differently when created as PCs. So, if you ever allow large PCs (which I would were I DMing Dark Sun, for instance), you might include in the race a feature such as the hill dwarf resilience, but it does not seem much in place in 5e to actually mess with the hit dice.
If you want to improve monsters, just do it, regardless of rules for player creation. If you want a frost giant with barbarian-like abilities and improved resilience, just add the barbarian abilities you think make sense, increase the number of hit dice to the amount that generates the HPs you are aiming at and check the final CR according to DMG guidelines. There is no need to add actual PC classes, change HD sizes, or anything more complicated. Also, have in mind some features of the PC classes might even interact weirdly with the monster rules (such as extra attack from warrior classes and the monster multiattack feature).