OpenSC has a basic command line tool that can sign data: pkcs15-crypt (see man page, doc/tools/index.html or online manpage).
But most users would prefer a nice graphical tool to display the content they are bout to sign and show the details of the smart card they are using.
OpenSignature is a graphical user interface for Windows, Linux and Mac OS X for signing documents. Binaries are available from the web page. The software is released as Open Source software under the GNU General Public License, full source code is available.
OpenSignature has a focus on Italian eID cards.
Cryptonit is a multi plattform application for signing, and encryptiong files and decrypting them. It can use smart cards via PKCS#11 modules. Binaries and soruce code are available from the sourceforge project. The software is released as Open Source software under the GNU General Public License, full source code is available.
FIXME: not tested