See the demos directory (/source/demo) of the distribution package. The Echo server would be a good sample for you!
I Tried The ECHO Demo Under Kylix, But It Didn't Work. Why?
You can see other TCP server examples in demos directory. See HTTP proxy demo or HTTP Server demo.