Imam Ibn Juzai Al-Maliki (d. 741 A.H) writes:
Tenth Chapter: About the visiting of the grave of the Prophet (saw) and mentioning of the Haram and the Holy places.
It is permissible for the one who performs Hajj to go to Madinah, and to enter the Masjid of the Prophet (صلى الله عليه وسلم) and to pray in it, and to recite the Salaam upon the Prophet (صلى الله عليه وسلم) and upon his companions Abu Bakr(r) and Umar(r), and to seek intercession through him (صلى الله عليه وسلم) to Allah (سبحانه و تعالى), and to pray between the grave and the Minbar, and to bid him farewell when leaving Madinah.
And from the places that are allowed to visit them for blessings are: The grave of Prophet Isma’eel (a.s) and his mother Hajrah (s.a), and the grave of Adam (a.s) and the cave that is mentioned in the Holy Qur’aan, and the cave in the mountain Hira where the revelation to the Prophet (صلى الله عليه وسلم) began, and the visiting of the graves of Makkah and Madinah that belong to the Sahaba, the Tabi’een and the scholars.
[Al-Qawanin Al-Fiqhiyyah Fi Talkhees Madhhab Al-Malikiyyah. Pg. 257 – 258]
Note that according to the Wahhabi religion, even visiting the cave of Hira leads to Shirk.