To the best of my knowledge it is not possible to purchase a Kazakh visa at the border. We're applying here in Canada for our Kazakh visas and for a single entry tourist visa a letter of invitation is not required. We do need to have a letter of introduction which is basically a cover letter for the visa application that gives some details on our trip.
China also does not give visas at the border and also doesn't require a letter of invitation. We are going to obtain that here in Canada as well. Yes, to operate private vehicle in China you need to have a guide with you at all times. As motorcyclists this can get quite expensive since the guide needs a car to ride around in that you have to rent. You may also need to have a driver for the car. And then you pay the food and accommodation for both of them too. What most people do is hook up with a group to spread the costs around. If you do a bit of digging on the HUBB you'll see quite a few posts of people arranging such groups.
We are sharing a trip from Mongolia to Beijing, Xi'an and Shanghai with a British couple in a car in September. Then next Spring we're thinking of riding from Nepal through Tibet to Kyrgyzstan with another group.
Have fun planning!
'84 R100RT 141,000 km (Dad's!)
'89 R100GS 250,000 km (and ready for another continent)
'07 R1200GS Adventure 100,000 km (just finished Circumnavigating Asia)