How can I draw squares in the transmitted image? Is this possible to do with the help of "C: \ Program Files \ Milestone \ MIPSDK \ ComponentSamples \ BoundingBoxMetadataProvider"?

Yes. The sample can submit metadata in the form of bounding boxes to the XProtect VMS. If the metadata source is then added to a camera as related the Smart Client will display the bounding boxes on top of the camera footage. See this explanation - https://doc.developer.milestonesys.com/html/index.html?base=samples/boundingboxmetadataprovider.html&tree=tree_2.html

Is a client plugin the only way to get a metadata overlay that is not a box or text? For example, a bitmap overlay?

Yes. You are correct. When you implement a client plugin you can use any shape as overlay.

Analytics Overlay plugin sample is the simplest sample to show this.

https://doc.developer.milestonesys.com/html/index.html?base=samples/analyticsoverlay_sample.html&tree=tree_1.html