Umm, don't take me for a Linux God or anything, but I have some thoghts on the issue I'm just sharing since no-one else is replying
but wouldn't you rather communicate with your device through your driver or kernel or whatever? this will be safer and ensure more portability of your program. But I'm sure you know all that anyway.
On home computers in the early eighties you'd solder up a piece of hardware, plug it in, and then write a program to use it, in the computer's built in language. But this isn't something people do these days.
Anyway, what are you looking to communicate with?
If you want to send a string to a port, then use something like
echo "we like sheep" > /dev/ttyS0
I have a teletype on ttyS0, so I get this text appear on there.