Hello , is there any way to dynamically create a product and add a buy button inside a custom component (something like shortcode) ?
The question is a bit abstract
Just putting a button will make no sense.
A form should exist with the proper fields and also the corresponding scripts that call the ajax request for the add-to-cart functionality.
Have a look at the source code inside a product and check the source code
although we recently discovered this-> http://forum.virtuemart.net/index.php?topic=132011.0
Just use this plugin
http://extensions.virtuemart.net/products/products-anywhere-detail