hmm, well for melee weapons i think it should be something simple like...
(a + h + c) * (w + 1)
where a, h and c are all constants (maybe 1?) but h is 2 if its headshot, otherwise its 0 (not sure if you get extra xp for headshots in melee though) and c is 2 if the hit was from a couched lance, otherwise its 0.
w is the weapon master skill (needs the +1 so you can get weapon skill if your weapon master skill is 0)
and for ranged weapons... maybe something like...
((h + a) * (c / 2)) * (w + 1)
where a is a constant (maybe 1?)
c is the shot difficulty (divided by 2 because x10 xp for shot 10 difficulty seems a bit much, but i could be wrong)
h is zero if its not a headshot or 2 if it is (i know if you get a headshot you get more than double xp, not sure exactly how much though)
w again is your weaponmaster skill
Most of this is just an educated guess though... and with limited information of how the weapon experience system works.... Im assuming it works like level experience but the experience is kept hidden and only shows the levels of your weapon skills.
EDIT: oh i forgot, you get extra experience if you kill someone with a couched lance... *adds it in*