My $.02:
McCartney is the king of melodic bass in rock music.
But also check out Jack Bruce's wonderful solo album, "Harmony Row." And, his work on "Disraeli Gears" and the studio portion of "Wheels of Fire" (both with Cream). Like McCartney, he's an overall musical genius who happens to play bass, along with other instruments (and who composes and sings brilliantly). But he's also classically trained (on 'cello) and is heavily influenced by Bach, as well as by Mingus, Jamerson and the Beach Boys' "Pet Sounds!" All this comes out in his melodic bass playing. He's still going strong today, but I'd start with the early ones I recommended above.