libnbd is easy to use

struct nbd_handle *nbd;

nbd = nbd_create ();

nbd_connect_unix (nbd, "/tmp/socket");

nbd_pread (nbd, buf, sizeof buf, 0, 0);

nbd_close (nbd);

... also a low level, high performance, asynchronous (AIO) API