There are proto_tree_add_<objectType>(), proto_tree_add_<objectType>_format() and proto_tree_add_<objectType>_format_value() methods to add elements to a tree that are computed or in variables, e.g. proto_tree_add_bytes(). See README.dissector for more information.
When using these routines the tvb start argument should approximate the location in the tvb where the value is derived from and the length argument should be 0 (as it's not in the tvb).