Important note: All examples that I use in this answer are restricted to the situation of just coming from another place to the current location or vice versa. I am aware of that in another context some sentences that I designated as incorrect may be fine.
As you already know, the difference between hin and her is whether you go to or away from the speaker.
For example, if you are outside of a building you can say:
Geh hinein.
Er ist hineingegangen.
If you are inside of a building you can say:
Komm herein.
Er ist hereingekommen.
In case of nach hier you cannot make such a comparison as hier is always the position of the speaker. Logically speaking, you must say hierher as the target is the speaker's position and the other person is coming from somewhere else.
A couple of further arguments for this:
There are two wordpairs dorthin/dorther and dahin/daher where no doubt about its usage exists.
nach dort: Geh mal dorthin.
nach dort: *Geh mal dorther.
von dort: Ich kam dorther.
von dort: *Ich kam dorthin.
nach da: Geh mal dahin.
nach da: *Geh mal daher.
von da: Ich bin daher gekommen.
von da: *Ich bin dahin gekommen.
The respective questions are:
nach wo: Wohin gehst du?
nach wo: *Woher gehst du?
von wo: Woher kommst du?
von wo: *Wohin kommst du?
In the first example the speaker is another person than the person who is moving. The problem you're seeing occurs when speaker and mover are the same person:
3.1 If you are outside of the building you must say hinein. No doubt. You go away from your current position and thus you go hinein. It's the same dorthin or dahin.
nach dort: Ich gehe dorthin.
nach dort: *Ich gehe dorther.
nach da: Ich gehe dahin.
nach da: *Ich gehe daher.
3.2 If you are inside of the building and you came from outside, you must say herein as you would say dorther and daher. You come from another place to your current position:
von dort: Ich komme dorther.
von dort: *Ich komme dorthin.
von da: Ich komme daher.
von da: *Ich komme dahin.
Finally, the but; and unfortunately I cannot give a reason but in case the speaker and mover are the same person it's acceptable to use hinein or hierhin although it seems to be contradictory to what I just said.
I guess that if you just came to your current position, the reason might be that you still consider this as an on-going progress. While you're moving you go hin. And when you just arrived your position, you are somehow still in progress; hence, it's acceptable to use hin.
That said, it still doesn't explain why you can say Ich bin letztes Jahr schonmal hierhin gekommen. Well, I could make another guess but I'm afraid that could sound far-fetched.
So, all of the following sentence are acceptable:
Ich stehe vor dem Gebäude und gehe jetzt hinein.
Ich stand vor dem Gebäude und kam dann herein.
Ich stand vor dem Gebäude und bin gerade hinein/herein gekommen.
Ich bin hierhin/hierher gekommen.