In your example sentence, "the majority of whom were men" is a relative clause (i.e., an adjective clause). The subject of this clause is the noun phrase "the majority of whom," in which the prep phrase "of whom" modifies the "the majority." This type of construction is called a nominal partitive, as it conveys a relationship of partialness (i.e., "the majority" is a part of "whom"). In other words, the predicate of the relative clause ("were men") applies not to the antecedent of "whom" (the "yoga class") but rather to "the majority" of the class.
Incidentally, the use of the word "class" in your example sentence is slightly problematic. In the context of the main clause ("I attended the yoga class"), "class" refers to the course itself; however, in the context of the subordinate clause, "class" refers to the group of students participating in the course. This inconsistency could be rectified by replacing the main verb ("attended") with "was a member of" or by replacing the relative clause with "in which the majority of students were men."