In Linux or OS X, you can use pppd for the TCP/IP part. Write a program which communicates with your device and converts between your device's protocol and PPP frames written to stdout and read from stdin. Then you would run pppd as superuser and "connect" to your program (e.g. "/home/joe/ppptranslator") instead of a serial line or a modem:
sudo pppd nodetach pty /home/joe/ppptranslator
PPP is easier than TCP/IP, but it's still challenging. Good luck!
Here is some reading:
PPP:
<a href="https://www.ietf.org/rfc/rfc1661.txt">https://www.ietf.org/rfc/rfc1661.txt</a>[<a href="https://www.ietf.org/rfc/rfc1661.txt" target="_blank" title="New Window">^</a>]
HDLC frames (PPP lowest level):
<a href="https://www.ietf.org/rfc/rfc1662.txt">https://www.ietf.org/rfc/rfc1662.txt</a>[<a href="https://www.ietf.org/rfc/rfc1662.txt" target="_blank" title="New Window">^</a>]
IP in PPP:
<a href="https://www.ietf.org/rfc/rfc1332.txt">https://www.ietf.org/rfc/rfc1332.txt</a>[<a href="https://www.ietf.org/rfc/rfc1332.txt" target="_blank" title="New Window">^</a>]
The TCP/IP Guide:
<a href="http://www.tcpipguide.com/free/index.htm">http://www.tcpipguide.com/free/index.htm</a>[<a href="http://www.tcpipguide.com/free/index.htm" target="_blank" title="New Window">^</a>]