Buses exist between Nagano and Hakuba; they are run by Alpico and you can check the timetable in the link. Unfortunately for you, the last bus leaves Nagano at 8.10 p.m. Another bus is scheduled to leave Nagano at 9.10 p.m. but it only runs until the 15th March so you cannot use it. The first bus on the morning of the 24th leaves at 7.55 a.m. and gets you to Hakuba at 9.05 (station) or 9.10 (Happo bus terminal). It is not covered by the JR pass, as far as I can tell.
The problem with going from Nagano to Hakuba directly is that they are in two different parallel valleys and going from one to the other requires crossing a mountain pass. Therefore, this is not a common direction of travel, only buses serve the route and they do not do so very frequently. You can go by train; this involves taking a limited express from Nagano south to Matsumoto and then local trains back north
Coming from Tokyo, there are two general routes to get to Hakuba by train:
Take a Hokuriku Shinkansen from Tokyo or Ueno station past Nagano all the way to Itoigawa on the North coast and a local train from there
Take the Limited Express Azusa from Shinjuku to Matsumoto and a local train into the valley from there.
However, your late arrival at Narita means that there is no way you will make it to Hakuba from Tokyo on the same day as the line between Matsumoto and Itoigawa is a very small local line with infrequent (by Japanese standards) service. The last trains arrive at Hakuba around 10.40 pm which require you to leave Tokyo before your flight lands. Thus, you will have to break your journey somewhere and stay overnight unless you want to fork out money for a late night taxi Nagano–Hakuba (Nagano probably being the closest you can get to Hakuba by regularly scheduled trains before night-time closure).
I would love to be able to suggest breaking the journey in Matsumoto which features Matsumoto Castle, one of the few remaining original Japanese castles and definitely a sight to see if you can set time aside. Doing so requires you to take the train out of Narita airport at 7.15 p.m. which may or may not work when your aeroplane lands at 6 p.m.
Aside from that, the other most logical option is breaking your journey in Tokyo, i.e. finding a hotel for the night there. Next morning, you can hop either on an early Azusa for Matsumoto or on a Shinkansen to Itoigawa. In fact, there is a 7.30 a.m. departure from Shinjuku that will bring you to Hakuba directly in 4 hours.
To sum it up:
To check for departure times, the most recommended site is Hyperdia.com which also has apps for iOS and Android available. I personally use the JapanTravel App which is also available for iOS and Android. Google Maps and Apple Maps also very good for checking train schedules.
Note that depending on where in Tokyo you are a different route might be faster. Searching from Tokyo station, it seems that Hokuriku/Nagano Shinkansen options are faster although they look less logical on a map. If you have control over where in Tokyo your hotel is, this is worth considering.