how is "them" an indirect object in this sentence? Only because of the use of "with"? Otherwise, it looks like a direct object to me.
Yes, dative is used with preposition mit and some verbs require dative for their objects. Here is an explanation of dative case, dative prepositions and dative verbs: http://german.about.com/library/blcase_dat.htm http://german.about.com/library/blcase_dat2.htm http://german.about.com/library/verbs/blverb_dativ.htm
What follows "mit" is in the dative case. "him" in dative is "ihm", not "ihn". "ihnen" in dative is is "them". Note that "Ihnen" (uppercase "I") is "your" (formal).
Would "Ich spiele mit Ihnen." then mean "I play with you (sir/mam)" as in "Wie geht es Ihnen" means "How are you (sir/mam)".
Ihnen is a dative form from Sie (you in formal) and the dative form from ihr is euch