you can create a rectangular extruded hollow surface with rounded edges, then create a helical surface around the rectangular surface. Extract the curve from the intersection of the two surfaces and use a sweep to create your spring.
Another way to do it is to form a curve on an extruded rectangular surface using pythagores theorem.
If you need some help with the second method just let me know.