It seems like this is nearly all possible already (see below). It is a little wonky that you have to put text in a src txt block to achieve it, but otherwise what is missing?
* Main document
See [[id:BAD97113-3561-4A4A-BA07-0CD5BF6BA35F][There is a reason we only support two args]] (text to text) for notes about this function. The addition is done in line [[(add)]] (text to code).
#+NAME: DOC-OF-ADD
#+BEGIN_SRC txt
"We use the function add to calculate the sum of two numbers."
#+END_SRC
#+NAME: ADD
#+BEGIN_SRC emacs-lisp -n -r :noweb yes :tangle test.el
(defun add (x y)
<<DOC-OF-ADD>> ;; code to code
;; [[id:BAD97113-3561-4A4A-BA07-0CD5BF6BA35F][There is a reason we only support two args]] code to text
(+ x y) (ref:add)
)
#+END_SRC
#+RESULTS: ADD
: add
** Notes
*** There is a reason we only support two args
:PROPERTIES:
:ID: BAD97113-3561-4A4A-BA07-0CD5BF6BA35F
:END: