Each Mii collected through StreetPassing becomes a "unit" that can be used in the dungeons. Each attack and progress made will carry over to the next time you enter Find Mii. If you StreetPass with the same person multiple times, that person's Mii will level up and become more powerful. The shirt color of your collected Mii units corresponds to the type of magic they use.
Black Magic: Darkness.
Brown Magic: Summon a "wandering hero".
Green Magic: Next hero will gain extra power.
Orange Magic: New heroes that enter will get a morale boost.
Pink Magic: Heroes are "full of daring" and less likely to be scared.
Red Magic: Burning flames (does extra damage against blue ghosts).
Yellow Magic: Sandstorm (lowers the chance of getting scared) and allows damage against enemies holding a yellow shield.