Here's something I put together in under 5 minutes to change the icon on a specific window. You could easily use this code to create a winform that would enumerate the currently open windows and allow you to assign arbitrary icons to them. (C# code below)
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr FindWindow(string strClassName, string strWindowName);
[DllImport("user32.dll",CharSet=CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern int DrawMenuBar(int currentWindow);
const int WM_GETICON = 0x7F;
const int WM_SETICON = 0x80;
const int ICON_SMALL = 0; //16
const int ICON_BIG = 1; //32
public static void SetIcon()
{
//Load an icon. This has to be a *.ico.
System.Drawing.Icon i = new Icon("path\to\icon");
//Find the target window. The caption must be entered exactly
//as it appears in the title bar
IntPtr hwnd = FindWindow(null, "Caption of Target Window");
//Set the icon
SendMessage(hwnd, WM_SETICON, (IntPtr)ICON_SMALL, (IntPtr)i.Handle);
//Update the title bar with the new icon. Note: the taskbar will
//update without this, you only need this if you want the title
//bar to also display the new icon
DrawMenuBar((int)hwnd);
}