According to A Dictionary of Answers to Common Questions in English (written by Zhao Zhencai, a Chinese Professor of English), afraid of (doing) sth can mean either "worried or anxious about sth. which might happen" or "unwilling to do sth because you are frightened." But afraid to do sth can only mean "unwilling to do sth because you are frightened." For example: I'm afraid of telling her the truth. I'm afraid to tell her the truth. He is not afraid of dying. *He is not afraid to die.
However, the following example is quoted from American Heritage Dictionary,
- Filled with fear: afraid of ghosts; afraid to die; afraid for his life. http://dictionary.reference.com/browse/afraid%20
Which book is right, American Heritage Dictionary or A Dictionary of Answers to Common Questions in English?