My understanding is that "The Wanderer" wasn't specifically written for Johnny Cash. They tried cutting it with Bono on vox but ran into Johnny Cash at one of his shows (or maybe at one of their shows) and asked him to record it with them. Pretty sure about this since it always struck me as unusual, given how perfectly the song captures Cash's persona.
Dunno about "Numb." The story I've heard is that Edge made it up under mounting frustrations and that Bono didn't have much to do with it.