You'd need some sort of hardware interface. If you just want to generate a high/low signal, you can simply use a USB to serial adaptor, and set the DTR and RTS lines as needed. You could also read signals over the CD, DSR, CTS, and RI lines. This would give you 2 lines out and 4 in. I'm not sure how exactly to address the serial port in ObjC/Cocoa, but I'm certain there's a way, either via the built-in serial library or some third party library.
If you're looking to do something more complicated, or require more control lines, you might want to look into using an Arduino or similar microcontroller as your hardware interface. You could hook up your input/output lines (the Arduino Uno gives you a total of 20 I/O lines (although only 18 if you're controlling it via your computer) and if you need more you can always multiplex them via a shift register. You can either write your code directly to run on the Arduino, or set it up so it accepts commands from the computer to turn the pins on and off.