The source code can be found under LB:[CGIDEMO].
These demos all test both reading and setting cookies, as well as reading values posted, and sending reponsoses based on this back to the browser.
There are demo code for both IND, BASIC+2 and PDP-11 C. However, the CGI interface is still primitive, and very little exists in the form of libraries to help handling this. The most developed libraries exists for IND, which have been used for some HECnet information pages that are served from MIM.
This is all experimental, and in development. Further improvements will probably come. In particular, CGI do not handle "multipart/form-data" yet, so it it not possible to upload files and similar activities.