Both the poem and the song are among my favorites, and fully worth re-reading or listening to again. I encourage you to come up with a more detailed analysis, but I will help you get started with context comparison.
First of all, the subect of both the poem and the song lyrics is the same person, Richard Cory. He is well known around town, wealthy, respected, and envied. The speaker is the same as well, as both are told from a first-person point-of-view. Both end in the same dramatic irony with the man who seemed to have everything committing suicide.
The biggest differences between the poem and the song lyrics is the song lyrics are more detailed. It is almost as if the song gives the story behind the poem. Notice the refrain of the song, "I work in his factory." The speaker here is not just one of the many people in the town who has hears of or sees Richard Cory on a regular basis. It is a man who works for Richard Cory. The song lyrics do not suggest a personal relationship (factory work is hardly personal), however, the speaker has a bit more credibility in the song. The song also goes into more detail about Richard Cory. Everything is contextually relevant, and sounds like it could be true based on the few clues from the poem.