You're asking 3 different things
I'll explain how to change the application window's icon.
(I'm not used to working with MFC, so i'll use some API)
Load the icon from your resource using
HICON icn = ::LoadIcon(::GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_ICONx))
You may set the icon using SetClassLong
You must use the Shell Links api to set your desktop shortcut's icon. Check msdn for some examples
To set your application's documents' icons, modify the registry
(assuming your document's extension is .abc)
Set icons in this path
The value will be the path to your executable file, followed by a number
where the number 0 (or 1,2) is the order number of the icon resources in your executable.
Just check out some registry keys to understand