That's a little bit of a confusing question. Are you asking about off-line B-Spec or on-line B-Spec. Either way I think there is just a certain amount of XP you get depending on the position you finish in.
Why do you ask? Are you trying to figure out a way to level up quicker?
It's been a while since I've booted up GT5 but did get to level 40 in A-Spec and B-Spec. Certain races are a better than others with the amount of XP you win.
I am asking about Offline. So say you win an event in first place and the total XP won is 400,000. If you have four drivers in the race, do each win the 400,000? Or do they each get 100,000? Or does it depend on how much each driver ran in the race?