Usage of shadow creatures in dont starve (playing as a Maxwell)
Solution 1:
What you're referring to is the Codex Umbra. The article explains it in great detail, but to answer your questions:
The man with the sword (Shadow Duelist) will either defend you if attacked or will attack whatever you attack (note: like with Pigs or Bunnies, you don't need to actually attack - you can just click to attack and then stop).
The man with the shovel (Shadow Digger) will only dig graves and stumps.
The shadows will disappear 2.5 days after you summon them.