Okay, this is what I've calculated based on this population projection. NOTE, it is NOT 2040, but 2050. I looked for state projections to 2040, but could not find any. The Census Bureau projects the US population in 2050 will be about 439 million. I used the closest number in this report http://www.fairus.org/site/DocServer/pop_projections.pdf?docID=901, which projects 444 million people with a low-trend immigration curve. As you can see there are large population growth in the South West due to immigration.
Keep in mind, this electoral map has assumes a House size of 437, not 435.
I'll say Texas and Virginia are swing states, while the Great Lakes area more Republican (with the exception of Ohio).
Slightly larger map: http://i12.photobucket.com/albums/a214/MasterRegal/2050ElectoralMap.png
Honestly, you think Wyoming, Idaho, Montana and Nebraska don't gain another 2 more electoral votes or so? The Dakotas would benefit a couple more also, Colorado needs at least 2 more added to the ten. New Mexico might get 1 electoral vote.
The only states that lose electoral votes would be CA, NY, MI, IL, OH and some other ones in the northeast.