1. I visited there yesterday.

2. I have been to there.
3. I have been there.
4. I needn't have gone to there.
5. I needn't have gone there.
---------------------------------
Are they all grammatical? Can we use 'there' as a noun as in the sentences?

2 and 4 are incorrect. The word "to" is not needed.

The others are fine.
The word "there" is an adverb, telling where.