The fine folks Perceptive Development has created a system that they hope to bring to the masses that will allow users to connect a keyboard, via infrared to your iPhone.
PerceptDev engineers have created a hardware/software solution that say involves electronics that total less than $20. The solution involves a microprocessor emulating a modem that detects an infrared signal or can read from a USB host controller. The signal is converted to FSK for transmission to the iPhone.
An iPhone application was then created to decode the FSK signals into text.