In a nutshell it goes like this: you file a flight plan to go from A in country A to B in country B. Every country that you cross will know about this.
Depending if you fly IFR or VFR and at what altitude, you will talk to either a flight information service (FIS), Radar or Area Control Center (ACC).
Hand-off is usually done a few miles from the border of the next country you're going to pass. You tell them who you are and where you're going to. They can let you fly as planned or give you another route or altitude.
From a pilot's point of view is pretty simple and straightforward.