Another vote for border collie here. My border collie mix does EXCELLENT. She'll herd the horses to me when asked but leave them alone when riding, she easily goes on 16+ mile trail rides with out a problem along side the horse and keeps up just fine. She also frequently flushes out things like deer, which was great for desensitizing my mare when I first started riding her. (now she doesn't bat an eye at deer and such jumping out in front of us.) She also keeps neighbor aggressive dogs away from my horse, which is a big help.
Aussies are great too, I have one of those as well. However my Australian Shepherd usually tends to stay toward home, I've had others that worked out great as trail riding companions too.
Another one to consider would be a Rhodesian Ridgeback, rhodies are MADE to go on up to 30mile runs in a day and easily tolerate the heat too. They are excellent work out buddies and trail riding buddies, and LOVE to run.
Of course, with any of these dogs they probably wouldn't do well in say, an apartment. They need and enjoy exercise and having things to do. (especially in the case of borders and aussies) if they get bored, they get destructive and hyper. So the final thing I guess would come down to what you'll be doing with the dog when not trail riding/what sort of setting he'll be living in, be it in a kennel or in a yard or whatever.