How to set permissions of creating content only for referenced users
If you are using the Node Reference URL Widget to add the create link then you could use panels (with the built in context) to hide that link if the user is not referenced on that node. This would not stop people from going to the url directly but would keep the honest people from creating content on nodes that they are not referenced on.

If you need a more secure way to prevent the creation of the document nodes I assume you would need to write some code or do some rules magic.

Rules magic idea: Create a flag that is hidden like I mentioned above. When the node is flagged then if the user reference is the current user then create the node and go to the edit page(and unflag when done). If not then unflag and show a message.