Firearms as defined under Title 18 U.S.C. 921(a)(3)(C) are devices designed to expel a projectile by the action of an explosive. So springs, compressed gases, twisted cord, and
massive weights are all fair game. However I suspect the authorities would take a dim view if you were to place some miscreant of some description in the sling of the trebuchet and fling him/her a few hundred yards through the air. Though I agree that would be gobs of fun.
Steven