As Alex mentions, TFS Sidekicks from Attrice has this functionality.
In addition, the TFS Power Tools allows you to use "Find in Source Control" to see what files are checked out by any (or all) users.
However, if you did want to roll your own solution, you could do so pretty easily using the TFS SDK. I'll let the documentation speak for itself, but you'll probably want to do something along the lines of:
TfsTeamProjectCollection projectCollection = new TfsTeamProjectCollection(new Uri("http://tfs.mycompany.com:8080/tfs/DefaultCollection"));
VersionControlServer vc = projectCollection.GetService<VersionControlServer>();
/* Get all pending changesets for all items (note, you can filter the items in the first arg.) */
PendingSet[] pendingSets = vc.GetPendingSets(null, RecursionType.Full);
foreach(PendingSet set in pendingSets)
{
/* Get each item in the pending changeset */
foreach(PendingChange pc in set.PendingChanges)
{
Console.WriteLine(pc.ServerItem + " is checked out by " + set.OwnerName);
}
}
(Note: totally untested)
But again, I'd recommend you check out those two existing projects to see if they fit your needs.