What is the proper way of writing a flake that outputs a .h header and a .so lib?

I am writing a flake which outputs a .h header and a .so lib. Is it as simple as installing the header in $out/include and the lib in $out/lib? Do I need to run ldconfig or something like that?

Also, after doing this, how to utilize the header and the lib that may be installed via the flake when compiling a C/C++ project?