I only know how to do this with the parallel port, sorry
see this page to control parallel port over web
http://www.epanorama.net/circuits/parallel_output.html#webcontrol
Files here:
http://www.epanorama.net/circuits/lptoutphp.zip
Not what you asked for but this is how I did it.
I also wrote a simple web server in VB to serve a controlling page and access the port
Here is one of my interfaces to the VB .exe server/port controller
http://dumdum.mark.googlepages.com/led.html
View Source, save & change the IP it calls
Download my ledcgi.exe that it calls here:
http://dumdum.mark.googlepages.com/ledcgi.exe
stick it in a cgi-bin in a Windows box
You'll need to install inpout32.dll (see below)
and regsvr32 it
Ports in XP are blocked, so you will need this driver to access the p. port -- inpout32.dll
http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html
It's much easier to use the parallel port than serial port!
Once you can control the port over the web you can hack remote controllers and control toys that way. I had a 8 legged infra-red controlled spider walking around viewed by a webcam -totally pointless -just like turning LEDS on or off -but loads of fun. Where there are buttons to press you just hard wire them to the port.
Connect power relays and you can turn anything on or off.
Here is a program that enables you to test your LEDS in the parallel port:
http://www.geocities.com/lalimparallel/index.html
!!!!!! !!!!!! !!!!! !!!!! !!!!!
N.B. I used opto-isolators( http://en.wikipedia.org/wiki/Opto-isolator ) to ensure that I did not fry the parallel port card by trying to draw too much current. It's the card you need to worry about, not the things plugged in.
But for LEDS you can just use the current limiting resistors as described in first answer. Full details are in my links above.