Optimality for totally real immersions and independent mappings of manifolds into C^N