처음으로 시험을 본거 치곤 잘 했다 = 처음으로 시험을 본 것 치고는 잘했다.
=> (I/You/They) have done well considering that it was the first exam (I/you/they) have taken.
=> (I) have done well if I take into account that it was the first exam I've ever taken.
치다(v) here means: take/consider into account (in judgment, calculation, etc).
So -ㄴ 것 치고는 means "considering that ...".
Examples:
- 겨울날(인 것) 치고는 별로 안 춥다 = 겨울날인 걸 생각하면 [감안하면] 별로 안 춥다 (more formal) = It's not that cold for a winter day.
- 처음으로 시험을 본 것 치고는 잘했다 = 처음(으로) 본 시험 치고는 잘했다 (more colloquial).