After struggling for a long time trying to get a many-to-any mapping working inside a Map with implicit polymorphism (table-per-concrete-class) I've finally figured it out. I've seen a couple posts asking for an example of a working many-to-any association, since seeing an example could've saved me a lot of time I'm going to post mine here.
Code:
<hibernate-mapping>
<class name="VariableContent"
table="VARIABLE_CONTENT">
<id name="id" type="int" column="ID">
<meta attribute="scope-set">protected</meta>
<generator class="native" />
</id>
<map name="contentMap">
<key column="foreign_key" />
<index column="map_key" type="string" />
<many-to-any id-type="int">
<column name="class_name" />
<column name="item_id" />
</many-to-any>
</map>
</class>
</hibernate-mapping>
That's it! Enjoy ;)