I suppose we could list a few hundred hymns, folk songs, blues, etc. that are influenced by the Bible. Here's Noel Paul Stuckey's "Wedding Song"
If comic books are included as literature there's Black Sabbath's "Iron Man" and Wing's "Magneto and Titanium Man".
The Pretenders did a song called "Thumbelina" but I don't think it has much to do with the fairy tale.
Led Zeppelin did a song called "Moby Dick" and Electric Light Orchestra did one called "The Whale". I'm not sure if either were inspired by Melville but at least ELO has whale song in theirs.
Another song that popped into mind is "The Friends of Mr. Cairo" by Jon Anderson of Yes and composer Vangelis. It might be inspired by the noir movies but the characters started in novels.
But I did discount poems put to music in the OP.
What about plays which were later transposed in opera, like Beaumarchais' The Marriage of Figaro" which was made in an Opera by Mozart?
hmmm... That's not really what I'm looking for. I'm looking for popular music that uses some literary work or even author (maybe in the same way Don McClean used Van Gogh in his song "Vincent," only that was an artist, not an author) as its inspiration.