First you need to compile the C library. Do something like:
gcc -shared example.c -o libexample.so
Of course, for a complex existing library compilation it can be much more difficult - if you wrap an existing library, it probably comes with some kind of Makefile that will help you create it.
Then in Lisp use CFFI to define and load the library. This is apparently the main part that you are missing.
(cffi:define-foreign-library libexample (t (:default "libexample"))) ;; note no .so suffix here (cffi:use-foreign-library libexample)
This part:
(t (:default "libexample"))
is a condition that you can use to provide different download instructions for different platforms. (t ...) is a catchall option, like COND. You can find the exact syntax in the documentation for define-foreign-library.
Now you usually use cffi: defcfun etc. to define functions in the library. This is what the SWIG-generated file does for you, so download it:
(load "example.lisp")
Now you can call functions like regular Lisp functions:
(fact 5) => 120
source share