It’s crafted as follows (you can replace planks with stone, ingots, or some other items for different vending blocks):
Place and right click it for a GUI:
Put the item you want to sell into left slot, the item you want to buy into right slot, and put some more of items you’re selling into storage area.
Now everyone else can right-click the vendor block while holding the item you’re buying to make the transaction. Items you bought go into storage area of the vending block.
When you have sold the last item (the one in the “Selling” slot), the tooltip will change and the vending block will just accept stuff for free.
To remove the vending block, empty its inventory and left-click it. Only the person that placed it can do that, and outside of creative mode, this is the only way to remove the vending block from the world.
Advanced vending block. You craft it the same way as the normal one, only using redstone repeater instead of redstone:
It has different GUI: you can’t put any items into buying slot, instead you press a button and pick the block you want to sell:
All new stuff is contained in a creative tab:
A wrench. Creative-only item without crafting recipe. Right click on a vending block to edit its settings: