many-to-many supports property-ref.
Assuming that there's a category table, which is your referential-intergrity table (but we'll pretend that it's a join table in this mapping):
Code:
<class name="MediaPackGroup" ...>
...
<set name="Packs" table="Category" ...>
<key column="categoryid"/>
<many-to-many column="categoryid" class="MediaPack" property-ref="Groups"/>
</set>
...
</class>
<class name="MediaPack" ...
...
<set name="Groups" table="Category" ...>
<key column="categoryid"/>
<many-to-many column="categoryid" class="MediaPackGroup" property-ref="Packs"/>
</set>
...
</class>
You don't need to map the category table if you don't want to. At least one of these tables needs an inverse="true" attribute: from your description, I'd say that both sides should be inverse (so that rows in the category table are never deleted).
I've never tried a mapping like this, where both the parent and child table use the same column in the join table, but I don't see any reason why it shouldn't be possible, if you set inverse="true" on both sides of the mapping.