The difference is in the meanings of to and for. In your case, the definitions that relate to relationships (especially between people).
- Identifying a particular relationship between one person and another.
- In support of or in favour of (a person or policy).
- On behalf of or to the benefit of.
This means that using
to indicates a relationship between two people, so your examples would fit this:
She is a good friend to me.
How special you are to me.
When using for, it would be applied differently, such as (not necessarily pertaining to the given definitions):
She was the friend I was looking for.
He is the special one for me.
Where for is used to define relations that are on behalf of or in favor of a person, and these above sentences therefore have different meanings than the ones you provided (which use to, not for).
If more examples may also be helpful for the uses of to and for, see the links to the Oxford Dictionaries here (to) and here (for).