I went over this with a Sheikh in Damascus and I though there was confusion among many Muslims in the West regarding this subject so I decided to forward his answer.
Visiting graves is a sunnah as we have hadith that the Prophet used to do it and not only to remember death but also to make dua’ for the dead. Visiting graves for any other reason is not impermissable unless there are impermissable elements within the action such as excessive grieving or paying people to grieve.
As for visiting the graves of those who were close to God, this is beneficial according to the scholars of Ahl-Sunnah wa-Jama’ because of the baraka surrounding the graves. It is also permissable to ask Allah through the righteous people who are dead. Many people say this is a form of shirk and one may only ask through those who are alive. This is inccorect rather, saying it is shirk is actualy approaching shirk because it assumes that life and death have an effect on asking through an intermediary and only Allah is able to effect matters. There is also another group of people who ask the righteous for certain things such as wealth or mercy. This is also inccorect for there is no power except that of God.
And God knows best and he is sufficient for us.