Take a look at this folder... you'll find plenty of stuff here.
Take a look at the format of things and you'll get the idea fairly quickly. I found a tutorial somewhere, but can't remember where. Anyway, I can post a better explanation tomorrow, as I'll be in front of an X box (pun intended) that I have setup WebCrossing to start automatically on startup.
I had trouble getting stuff in /Library/StartupItems working. I would copy the files other people have posted here, but it never seemed to work.
The trick, I found, was in the line-feed characters. I created my scripts using BBEdit, saved using Macintosh line feeds. It appears (I think, anyway) that if you the script will not execute properly.
To see why, open Terminal and do vi script_name. You'll see that the entire script is treated as one comment line with ^M charcters instead of proper line feeds. (This is because Unix uses \n characters for line feeds and the Mac uses \r.)
So, when you build your script, either use BBEdit to save as a Unix file, or use a Unix tool (vi, pico, etc.) to create the script.
Also, you should probably change the owner of the file to root, using "sudo chown root file_name"