How would I implement a polymorphic recursive modules for generic types?

One suggestion for really generic and extensible solution would be to use this library for generic programming in OCaml (or some other conceptually similar implementation). In this particular example it would be something like:

[@@@reify_all]

type 'a poly_val = { value : 'a }

let show_poly_val : type a. a ty -> a -> string = fun t x ->
  match t with
  | Poly_val t -> (* The not so trivial impl to be here *)
                  "Custom! poly_val: " ^ Gfun.show t x.value
  | t          -> Gfun.show t x

let () = Gfun.show_ext (Poly_val Any) { f = show_poly_val }

let p t x = print_endline (Gfun.show t x)

let () =
  p (Poly_val Int) { value = 5 };
  p (Poly_val String) { value = "line" }

Another suggestion can be to resort to object-oriented programming and use classes and open recursion to simulate the approach used in object-oriented languages.