Does the class do anything when there is no hero?
It counts wins towards class weapons
Yup. Class XP only counts when the Hero is present on the team but wins are counted if the class is equipped at all (Hero or not). So just assign the team any random class that you haven’t yet unlocked the Mythic Class Weapon for and go fight some battles. (Note that Orbs of Ascension, if used on a Class, merely contribute 100 or 250 wins to this counter)
When you’ve already unlocked the Class Weapon, equipping the Class without a Hero does nothing more except show it off to your opponent before the battle starts.
and ads +20 to gem mastery