Formal Welcomes: This is the primary use case. It is standard practice when greeting important business partners, foreign dignitaries, esteemed academics, or family elders at an airport, train station, or the entrance to a venue. It sets a tone of respect and formality right from the start.
Speeches and Ceremonies: It is very common for a speaker to begin an address by thanking the audience, especially if they have traveled for the event. For example, “首先,欢迎各位嘉宾远道而来…” (First of all, welcome to our distinguished guests who have come from afar…).
Expressing Gratitude: It can be used by the guest as well, but in a slightly different structure, to express humility. For instance, a guest might say, “我这次远道而来,给你们添麻烦了” (I've come from so far this time, I must have caused you a lot of trouble), which is a polite way of acknowledging the host's efforts.
Formality Level: The term is decidedly formal or at least very polite. Using it for a friend who lives across town would be seen as sarcastic or strange. The “distance” must be perceived as significant, either geographically (another city/country) or in terms of effort.